<?php
/*
 *      video.php
 *      
 *      Copyright 2011 root <root@godfather.typhoon.tycoon>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 *      
 *      
 */

?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<div id="container">
   
    <div id="imglist" align="center">
		<?=validation_errors('<div style="color:red" class="error">', '</div>'); ?>
		<?php if (isset ($error)) { ?>
            <div style="color:red" class="error"><?php echo $error; ?></div>
		<?php } ?>
		
		<?=form_open_multipart('subslide/index/');?>
        
			<table>
				<tr>
					<td><?=$this->lang->line('lang.i18n.messages.object.choose') . " " . $this->lang->line('lang.i18n.messages.object.picture');?>*:</td>
					<td><input name="userfile" type="file" size="30" /></td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<?=form_submit('btn_upload',$this->lang->line('lang.i18n.messages.object.add'));?>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
					<div style="color:red" class="error"><?=$this->lang->line('lang.i18n.messages.object.required_label');?></div>	
					</td>
				</tr>
				
			</table>
         <?=form_close();?>
        <br/>
		<br/>
		<?php 
			if(sizeof($images) == 0){
				echo $this->lang->line('lang.i18n.messages.form.empty');
				return;
				}
				
		?>
        <div class="imgfor">
		
		<table width="100%">
			<tr>
				<th><?=$this->lang->line('lang.i18n.messages.object.image');?></th>
				<th></th>
			</tr>
			
			<!-- Looping Array Image -->
			<?php foreach($images as  $image) {	?>
			<tr>
				<td align="center">
					<img style="max-width:150px; max-height:120px" src="<?=base_url().$dir.$image; ?>"/>
				</td>
				<td>
					
					<a class="adel" href="<?=site_url('subslide/delete/'. $image); ?>" onclick='return confirm("<?=$this->lang->line('lang.i18n.messages.object.confirm');?>")'>
					<?=$this->lang->line('lang.i18n.messages.object.delete');?></a>
				</td>
			</tr>
			<?php } ?>
			<tr>
			<td colspan="5" align="center"><div class="bottom">
            <?=$this->pagination->create_links(); ?>
        </div></td>
			</tr>
        </table>

        
    </div>

    <div class="clear"></div>

</div> <!-- end div container -->
